package com.eascs.admin.o2o.collectRecords.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eascs.admin.o2o.collectRecords.dao.CollectRecordsDao;
import com.eascs.admin.o2o.collectRecords.entity.CollectRecordsVo;
import com.eascs.app.dao.PageResult;
import com.eascs.app.dao.SqlPageQuery;
import com.eascs.common.util.StringUtil;

@Service
public class CollectRecordsService  {
	@Autowired
	CollectRecordsDao collectRecordsDao;
	public PageResult<Object[]> getListByPage(CollectRecordsVo vo) {
		return collectRecordsDao.getListByPage(vo);
	}

}
//SqlPageQuery<Object[]> sqlPageQuery = new SqlPageQuery<>(Object[].class, vo.getPageSize(), vo.getPageIndex());
//StringBuffer querySql = new StringBuffer();
//// -----------------------id-----loanapply_no--------贷款单号--------省区---
//querySql.append(" select orr.id,oll.loanapply_no,oll.bill_code,opr.province_name, ");////
//// ----------------信贷经理-------------借款人姓名-----------------
//querySql.append(" oll.operator_name,olu.customer_name as loaner_name, ");
//// ----------------------放款银行---------------------------------------------------------------------
//querySql.append(" ppd.item_name as loan_bank, ");
//// -------------放款金额-----回款总额(待改,实际是单次回款金额)------回款日期
//querySql.append(" obld.loan_amount,orr.received_amount,orr.received_date ");
//querySql.append(" from o2o_received_records orr "
//		+ " left join o2o_loanapply oll on oll.loanapply_no = orr.loanapply_no "
//		+ " left JOIN o2o_loan_user olu on oll.loanapply_no = olu.loanapply_no "
//		+ " left JOIN o2o_bank_loan_data obld on oll.bill_code = obld.bill_code "
//		+ " left JOIN o2o_platform_regional opr on oll.ltd = opr.platform_id "
//		+ " left join pub_dditem ppd on obld.loan_bank=ppd.item_code "
//		+ " left join pub_datadictionary pdt on ppd.dd_no = pdt.dd_no ");
//querySql.append(
//		" where 1=1 and /**DATA_PERMISSION(oll.ltd)**/ olu.spouse_id is null and olu.sponsor_type is null and pdt.dd_code = 'BANKTYPEO2O' and orr.is_del='N' ");// 付款类型'ZD'是什么
//if (!StringUtil.isEmpty(vo.getBillCode())) {
//	querySql.append(" and oll.bill_code like ? ");
//	sqlPageQuery.addLikeParam(vo.getBillCode());
//}
//if (!StringUtil.isEmpty(vo.getLoanBank())) {
//	querySql.append(" and loan_bank = ? ");
//	sqlPageQuery.addParam(vo.getLoanBank());
//}
//if (!StringUtil.isEmpty(vo.getOperatorName())) {// 信贷经理
//	querySql.append(" and oll.operator_name like ? ");
//	sqlPageQuery.addLikeParam(vo.getOperatorName());
//}
//if (!StringUtil.isEmpty(vo.getLoanerName())) {
//	querySql.append(" and loaner_name like ? ");
//	sqlPageQuery.addLikeParam(vo.getLoanerName());
//}
//if (!StringUtil.isEmpty(vo.getProvinceCode())) {
//	querySql.append(" and opr.province_code = ? ");
//	sqlPageQuery.addParam(vo.getProvinceCode());
//}
//
//querySql.append(" order by oll.bill_code desc ");
//// querySql.append(" order by orr.create_date desc ");
//sqlPageQuery.setSumColumnIndexs(new int[] { 8 });//放款金额统计、数据统计
//sqlPageQuery.setQuerySql(querySql.toString());
//return collectRecordsDao.findDataWithPage(sqlPageQuery);